/*
 * @Author: szx
 * @Date: 2021-11-01 11:59:04
 * @LastEditTime: 2021-11-01 12:02:03
 * @Description:
 * @FilePath: \leetcode\200-299\242\242.cpp
 */
#include <iostream>
using namespace std;
class Solution {
   public:
    bool isAnagram(string s, string t) {
        int n = s.length();
        if (n != t.length()) {
            return false;
        }
        int a[26]{0};
        for (int i = 0; i < n; i++) {
            a[s[i] - 'a']++;
            a[t[i] - 'a']--;
        }
        for (int i : a) {
            if (i != 0) {
                return false;
            }
        }
        return true;
    }
};
int main() { return 0; }